package entity

type CourseOption func(*Course)

func NewCourseEntity(opts ...CourseOption) CourseEntity {
	course := &Course{}
	course.UpdateEntity(opts...)
	return course
}

func (c *Course) UpdateEntity(opts ...CourseOption) {
	for _, opt := range opts {
		opt(c)
	}
}

func WithID(id uint) CourseOption {
	return func(c *Course) {
		c.ID = id
	}
}

func WithName(name string) CourseOption {
	return func(c *Course) {
		c.Name = name
	}
}

func WithDescription(description string) CourseOption {
	return func(c *Course) {
		c.Description = description
	}
}

func WithExperiments(experiments ...Experiment) CourseOption {
	return func(c *Course) {
		c.Experiments = experiments
	}
}
